package org.pp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.pp.entity.PpPublicConfig;
import org.pp.mapper.PpPublicConfigMapper;
import org.pp.service.IPpPublicConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * <p>
 * 系统配置属性 服务实现类
 * </p>
 *
 * @author haima
 * @since 2024-09-08
 */
@Service
public class PpPublicConfigServiceImpl extends ServiceImpl<PpPublicConfigMapper, PpPublicConfig> implements IPpPublicConfigService {

    @Override
    public String getConfigByName(String configName) {
        PpPublicConfig config = baseMapper.selectOne(new LambdaQueryWrapper<PpPublicConfig>().eq(PpPublicConfig::getName, configName));
        return Objects.isNull(config)?null: config.getValue();
    }
}
